package org.fanpeng.demo.design;

import org.fanpeng.demo.design.util.RedisUtils;

/**
 * className: ActivityController
 * Description:
 * date: 2021/8/10 15:44
 *
 * @author fanpeng
 * @version 1.0
 */
public class ActivityController {

    private RedisUtils redisUtils = new RedisUtils();

    public Activity queryActivityInfo(Long id){
        Activity activity =ActivityFactory.getActivity(id);
        // 模拟从Redis中获取库存变化信息
        Stock stock = new Stock(1000, redisUtils.getStockUsed());
        activity.setStock(stock);
        return activity;
    }
}
